//
//  HLStatuseBottonView.swift
//  HLwWeibo
//
//  Created by hqhxu on 16/3/3.
//  Copyright © 2016年 hqhxu. All rights reserved.
//

import UIKit

class HLStatuseBottonView: UIView {
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        prepareUI()
    }

    /// 添加ui设置相应的约束
    func prepareUI() {
        addSubview(forwardButton)
        addSubview(commendButton)
        addSubview(likeButton)
        addSubview(separateViewFirst)
        separateViewFirst.sizeToFit()
        addSubview(separateViewSconde)
        separateViewSconde.sizeToFit()
        
        let multipliedScale = 1 / 3.0
        // 添加约束
        forwardButton.snp_makeConstraints { (make) -> Void in
            make.leading.top.height.equalTo(self)
            
            make.width.equalTo(self).multipliedBy(multipliedScale)
        }
        
        commendButton.snp_makeConstraints { (make) -> Void in
            make.leading.equalTo(forwardButton.snp_trailing)
            make.top.height.width.equalTo(forwardButton)
        }
        
        likeButton.snp_makeConstraints { (make) -> Void in
            make.width.height.top.equalTo(commendButton)
            make.leading.equalTo(commendButton.snp_trailing)
        }
        
        separateViewFirst.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(forwardButton.snp_trailing)
            make.centerY.equalTo(forwardButton)
        }
        
        separateViewSconde.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(commendButton.snp_trailing)
            make.centerY.equalTo(commendButton)
        }
    }
    
    
    
    /// 转发按钮  timeline_card_bottom_background_highlighted
    private lazy var forwardButton:UIButton = UIButton(title: "转发", imageName: "timeline_icon_retweet")
    
    /// 评论
    private lazy var commendButton:UIButton = UIButton(title: "评论", imageName: "timeline_icon_comment")
    
    /// 点赞
    private lazy var likeButton:UIButton = UIButton(title: "赞", imageName: "timeline_icon_unlike")
    
    /// 分割线1
    private lazy var separateViewFirst:UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line"))
    
    /// 分割线2
    private lazy var separateViewSconde:UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line"))
    
    
}
